import java.sql.*;
public class OverPopulation {
	public static void main(String args[]){
		Connection con;
		Statement sql;
		ResultSet rs;
		con = GetDBConnection.connectDB("world","root","");
		if(con == null)return;
		String sqlStr = "select *from city where Population>4016531";
		try{
			sql = con.createStatement();
			rs = sql.executeQuery(sqlStr);
			while(rs.next()){
				int ID = rs.getInt(1);
				String name = rs.getString(2);
				String Countrycode = rs.getString(3);
				String District = rs.getString(4);
				int Population = rs.getInt(5);
				System.out.printf("%d\t",ID);
				System.out.printf("%s\t",name);
				System.out.printf("%s\t",Countrycode);
				System.out.printf("%s\t",District);
				System.out.printf("%d\n",Population);
			}
			con.close();
		}
		catch(SQLException e){
			System.out.println(e);
		}
	}
}

